﻿using DevExpress.Xpf.Core.Native;
using HandyControl.Data;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace PlaceOrder_Client.Converters
{
    public class RoleToHorizontalAlignmentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ChatRoleType role = (ChatRoleType)value;
            if(role==ChatRoleType.Receiver)
            {
                return System.Windows.HorizontalAlignment.Left;
            }else
            {
                return System.Windows.HorizontalAlignment.Right;
            }

            //ChatRoleType chatRoleType = (ChatRoleType)value;
            //if(chatRoleType == ChatRoleType.Sender)
            //{
            //    return HorizontalAlignment.Left;
            //}else
            //{
            //    return HorizontalAlignment.Right;
            //}

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
